package yuan;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

/**
 * @author 苑庆涛
 * @create 2019-12-27 10:16
 */
public class MyServletContextListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        System.out.println("ServletContext对象创建");
        WebSocketPolicyListener webSocketPolicyListener = new WebSocketPolicyListener();
        Thread thread = new Thread(webSocketPolicyListener);
        thread.start();
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
        System.out.println("ServletContext对象销毁");
    }
}
